package com.qr.mp.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.qr.mp.enums.SexEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/*
* activerecord的使用
* */

@Data
@NoArgsConstructor
@AllArgsConstructor
public class User extends Model<User> {

    private Long id;

    private String userName;

    // fill = FieldFill.INSERT插入数据的时候做一个填充
    @TableField(select = false,fill = FieldFill.INSERT)
    private String password;
    private String name;
    private Integer age;

    @TableField(value = "email")
    private String mail;

    @TableField(exist = false)
    private String address;
    //乐观锁字段
    @Version
    private Integer version;

    //逻辑删除字段
    @TableLogic
    private Integer deleted;

    //性别，枚举类型
    private SexEnum sex;
}